package chpt08;

import java.io.InputStreamReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.charset.Charset;

public class InputStreamReaderTest {
	public static void main(String[] args) throws IOException{
		try(InputStreamReader isr = new InputStreamReader(new FileInputStream("example.txt"),Charset.forName("UTF-8"))){
			char[] contents = new char[256];
			int len = isr.read(contents);
			String msg = new String(contents,0,len);
			System.out.println(msg);
		}
	}
}
